//=============================================================================
// Patriarch HP Left by Phada | 7 Sep. 2010 | http://phada.2ya.com/kf.xhtml
//=============================================================================
class MutPatHPLeft extends Mutator;

function PostBeginPlay()
{
	SetTimer(1.0, True);
}

function Timer()
{
	if (Level.Game.IsInState('MatchOver')) 
	{
		ShowHP();
		SetTimer(0.0, False);
	}
}

function ShowHP()
{
	local Controller C;
	local DKPatriarchBase Boss;
	local string Msg;

	foreach DynamicActors(class'ServerPerksV4C.DKPatriarchBase', Boss)
		break;

	if (Boss != None && Boss.Health > 0) {
		Msg = "Patriarch HP = "$Boss.Health$"/"$int(Boss.HealthMax)$" ("$(Boss.Health/Boss.HealthMax*100)$"%)";
		Log("SQUAD WIPED OUT: "$Msg);
		for (C = Level.ControllerList; C != None; C = C.NextController)
			if (PlayerController(C) != None)
				PlayerController(C).ClientMessage(Msg);
	}
}

defaultproperties
{
     bAddToServerPackages=True
     GroupName="KF-PatHPInfoMut"
     FriendlyName="Patriarch HP Left"
     Description="Shows the remaining health of patriarch when the squad wipe."
}
